package com.bbx.taxi.client.Activity.Base;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import com.bbx.api.gclient.GMsg;
import com.bbx.api.gclient.Observer;
import com.bbx.api.sdk.SDK;
import com.bbx.api.util.LogUtils;
import com.bbx.taxi.official.R;
import com.bbx.taxi.client.widget.SwipeBackLayout;

public class BaseActivity extends Activity   {
	protected SwipeBackLayout layout;
	private boolean IsSwipeBack = true;

	protected void onCreate(Bundle savedInstanceState) {;
		super.onCreate(savedInstanceState);
		if (IsSwipeBack) {
			layout = (SwipeBackLayout) LayoutInflater.from(this).inflate(
					R.layout.base, null);
			layout.attachToActivity(this);
		}

	}
    public void debug(String str){
    	LogUtils.debug(str);
    }
	
	public void onIsSwipeBack(boolean IsSwipeBack) {
		this.IsSwipeBack = IsSwipeBack;
	}

	protected void onDestroy() {
		super.onDestroy();
	}

	@Override
	public void startActivity(Intent intent) {
		super.startActivity(intent);
		overridePendingTransition(R.anim.base_slide_right_in,
				R.anim.base_slide_remain);
	}

	public void startActivityForResult(Intent intent, int code) {
		super.startActivityForResult(intent, code);
		overridePendingTransition(R.anim.base_slide_right_in,
				R.anim.base_slide_remain);
	}

	// Press the back button in mobile phone
	@Override
	public void onBackPressed() {
		super.onBackPressed();
		overridePendingTransition(0, R.anim.base_slide_right_out);
	}
}
